package org.opensource.webflux.apijson;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;

import static org.springframework.web.reactive.function.BodyInserters.fromObject;
import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
import static org.springframework.web.reactive.function.server.ServerResponse.ok;

@Component
public class MockHandler {

    @Bean
    public RouterFunction mock() {
        return RouterFunctions.route(GET("/xxx"), request-> {
            return ok().body(fromObject("test"));
        });
    }


}
